/**
 * @Title: MatrrialDefine.java 
 * @Description: TODO
 * @author <a href="mailto:psammead@126.com">Psammead</a>
 * @date 2011-7-16 上午10:38:44 
 * @version 1.0
 * Copyright 2011 by Psammead
 */
package com.psammead.dms.offer.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.psammead.dms.common.core.bo.AbstractBaseBO;

/**
 * @ClassName: MatrrialDefine
 * @Description: TODO
 * @author <a href="mailto:psammead@126.com">psammead</a>
 * @version 1.0
 * @date 2011-7-16
 */
@Entity(name="MaterialDefine")
@Table(name="tb_of_material_define")
public class MaterialDefine extends AbstractBaseBO implements Serializable {

	/**
	 * @Fields serialVersionUID
	 */
	private static final long serialVersionUID = -4076962495749027747L;
	private long id;
	private String name;
	private Double price;
	private int sort;
	private String description;
	private String remark;
	private MaterialType type;
	private OfferTemplate template;
	
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="define_id")
	@Override
	public long getId() {
		// TODO Auto-generated method stub
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}
	
	@Column(name="define_name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name="price")
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}
	@Column(name="sort")
	public int getSort() {
		return sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}

	@Column(name="description", length=512)
	public String getDescription() {
		return description;
	}
	
	public void setDescription(String description) {
		this.description = description;
	}
	
	@Column(name="remark", length=32)
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@ManyToOne(cascade=CascadeType.REFRESH,optional=true)
	@JoinColumn(name="type_id")
	public MaterialType getType() {
		return type;
	}

	public void setType(MaterialType type) {
		this.type = type;
	}

	@ManyToOne(cascade=CascadeType.REFRESH,optional=true)
	@JoinColumn(name="template_id")
	public OfferTemplate getTemplate() {
		return template;
	}

	public void setTemplate(OfferTemplate template) {
		this.template = template;
	}

}
